-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web: remove const qualifier for getMaterialInstances #6952
Conversation
web/filament-js/filament.d.ts
Outdated
@@ -624,7 +624,7 @@ export class gltfio$FilamentInstance { | |||
public getSkinNames(): Vector<string>; | |||
public attachSkin(skinIndex: number, entity: Entity): void; | |||
public detachSkin(skinIndex: number, entity: Entity): void; | |||
public getMaterialInstances(): Vector<MaterialInstance>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change here? The other getters return a Vector<>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMaterialVariantNames is wrapper by vectorToArray, which is convenient when iterate, so make this change to getMaterialInstances too.
What's the convention (vectorToArray or not) here, should all interfaces defined in filament.d.ts use Vector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this consistent with the other APIs and continue to return a Vector<MaterialInstance>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, reverted.
web/filament-js/filament.d.ts
Outdated
@@ -624,7 +624,7 @@ export class gltfio$FilamentInstance { | |||
public getSkinNames(): Vector<string>; | |||
public attachSkin(skinIndex: number, entity: Entity): void; | |||
public detachSkin(skinIndex: number, entity: Entity): void; | |||
public getMaterialInstances(): Vector<MaterialInstance>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this consistent with the other APIs and continue to return a Vector<MaterialInstance>
.
489bce1
to
97adec4
Compare
97adec4
to
12d306b
Compare
With the const qualifier on the returned MaterialInstances, we cannot call setter functions like setDepthWrite etc. from the object, caused by